# 2.打印出100以内的斐波那契数列，使用2种方法实现

#方法一
first = 1
second = 1
third = 0
print(1, 1, sep='\r\n')
for num in range(100):
    third = first + second
    if third > 100:
        break
    else:
        print(third)
        first = second
        second = third

#方法二
lst = [1, 1]
last = lst[-1] + lst[-2]
while last < 100:
    lst.append(last)
    last = lst[-1] + lst[-2]
print(lst)

# 结果都是对的
# 可以尝试将两种方式都改成函数来实现。